Skip to main content
Version: 5.6

TimeEntry Service

This service contains methods in order to work with the time-entries of TimePunch.

AssignTimeEntriesToCustomer

With this method, you can assign multiple time entries to a new customer.

void AssignTimeEntriesToCustomer(  
out TpFault fault,
TpAuthentication authentication,
Guid[] timeEntryIds,
Guid customerId);
Needed PermissiontimeEntries@restrictedEdit
NameModifierDescription
faultOutContains the error if an exception occurs.
authenticationUser authentication
timeEntryIdsArray of ids of the time entries that shall be amended.
customerIdNew customer Id that is used to update the time entries.

AssignTimeEntriesToProjects

With this method, you can assign multiple time entries to a new project.

void AssignTimeEntriesToProjects(  
out TpFault fault,
TpAuthentication authentication,
Guid[] timeEntryIds,
Guid projectId,
Guid taskId);
Needed PermissiontimeEntries@restrictedEdit
NameModifierDescription
faultOutContains the error if an exception occurs.
authenticationUser authentication
timeEntryIdsArray of ids of the time entries that shall be amended.
projectIdNew project Id that is used to update the time entries.
taskIdNew task Id that is used to update the time entries.

BatchFilterUpdate

This method updates all public and private filters in TimePunch.

TpFault BatchFilterUpdate(  
TpAuthentication authentication,
List<TimeEntrySearchDto> privateFilters,
List<TimeEntrySearchDto> publicFilters);
Needed PermissiontimeEntryFilter@manage
NameModifierDescription
authenticationUser authentication
privateFiltersCollection of private filters
publicFiltersCollection of public filters
Return valueFault object if an exception occurs

CheckTimeEntryOverlapping

This method checks whether the given time entry would override existing time entries in the database. Thus an unintended override of time entries can be prevented.

bool CheckTimeEntryOverlapping(  
out TpFault fault,
TpAuthentication authentication,
TimeEntryDto entryToCheckOverlapping);
Needed PermissiontimeEntries@access
NameModifierDescription
faultOutContains the error if an exception occurs.
authenticationUser authentication
entryToCheckOverlappingTime Entry that shall be checked against the existing time entries in the database.
Return valueReturns true, if the given time entry would harm existing time entries.

CopyTimeEntries

This method copies a list of time entries and reinstates them on the passed date.

void CopyTimeEntries(  
out TpFault fault,
TpAuthentication authentication,
List<TimeEntrySaveDto> entriesToCopy,
DateTime insertAt);
Needed PermissiontimeEntries@manage
NameModifierDescription
faultOutContains the error if an exception occurs.
authenticationUser authentication
entriesToCopyList of time entries to copy
insertAtDate from that the time entries shall be inserted.

CreateBreakTimeDummy

This method creates a break time entry. A break time entry is always required if there is a period of time between the last time entry and the following time entry.

TimeEntryDto CreateBreakTimeDummy(  
out TpFault fault,
TpAuthentication authentication,
DateTime startBreak,
DateTime endBreak);
Needed PermissiontimeEntries@access
NameModifierDescription
faultOutContains the error if an exception occurs.
authenticationUser authentication
startBreakStart time of the dummy break entry
endBreakEnd time of the dummy break entry.
Return valueThe created time entry

CreateNewTimeEntry

This method creates a new time-entry and returns it. The time-entry won’t be saved. Only after calling the save method it is available in the TimePunch profile.

TimeEntryDto CreateNewTimeEntry(  
out TpFault fault,
TpAuthentication authentication,
DateTime date);
Needed PermissiontimeEntries@manage
NameModifierDescription
faultOutContains the error if an exception occurs.
authenticationUser authentication
DateTimeDate that shall be used for creating the new time entry.
Return valueThe created time entry

DeleteTimeEntries

This method deletes the given time entries from the TimePunch profile. It’s important to know, that only time-entries of the authenticated TimePunch profile are allowed to be deleted.

void DeleteTimeEntries(  
out TpFault fault,
TpAuthentication authentication,
Guid[] timeEntryIds);
Needed PermissiontimeEntries@manage
NameModifierDescription
faultOutContains the error if an exception occurs.
authenticationUser authentication
timeEntryIdsCollection of time entry Ids that shall be deleted.

DeleteTimeEntriesInRange

This method deletes all time entries in the specified period for the selected employees.

void DeleteTimeEntriesInRange(
out TpFault fault,
TpAuthentication authentication,
DateTime startDate,
DateTime endDate,
Guid[] userIds);
Needed PermissiontimeEntries@manage
NameModifierDescription
faultOutContains the error if an exception occurs.
authenticationUser authentication
DateTimestartDateStart date to search for time entries
DateTimeendDateEnd date to search for time entries
Guid[]userIdsList of user ids that is used by the search

DeleteTimeEntriesAtDates

This method deletes all time entries at the given date values for the user.

void DeleteTimeEntriesAtDates(
out TpFault fault,
TpAuthentication authentication,
DateTime[] dates);
Needed PermissiontimeEntries@manage
NameModifierDescription
faultOutContains the error if an exception occurs.
authenticationUser authentication
DateTime[]datesList of date values on that the time entries shall be deleted.

DeleteTimeEntryFilter

This method deletes a time entry filter.

TpFault DeleteTimeEntryFilter(  
TpAuthentication authentication,
Guid filterId);
Needed PermissiontimeEntryFilter@manage timeEntryFilter@managePublic
NameModifierDescription
faultOutContains the error if an exception occurs.
authenticationUser authentication
filterIdId of the filter that shall be deleted
Return valueFault object if an exception occurs

ImportTimeEntries

This method imports the transferred time entries. The import takes into account not the IDs but the start and end times, as well as the project and activity names.

void ImportTimeEntries(  
out TpFault fault,
TpAuthentication authentication,
List<TimeEntryDto> rows);
Needed PermissiontimeEntries@restrictedEdit commonTasks@manage projects@manage
NameModifierDescription
faultOutContains the error if an exception occurs.
authenticationUser authentication
rowsCollection of time entries to import

LoadTimeEntries

This method should be used, if the time entry ids are known, in order to load the time entries.

List<TimeEntryDto> LoadTimeEntries(  
out TpFault fault,
TpAuthentication authentication,
Guid[] timeEntryIds);
Needed PermissiontimeEntries@access
NameModifierDescription
faultOutContains the error if an exception occurs.
authenticationUser authentication
timeEntryIdsArray of ids of the time entries that shall be loaded.
Return valueReturns the loaded time entries

LoadTimeEntryFilter

This method loads a time entry filter with the corresponding ID.

TimeEntrySearchDto LoadTimeEntryFilter(  
out TpFault fault,
TpAuthentication authentication,
Guid timeEntrySearchId);
Needed PermissiontimeEntryFilter@access
NameModifierDescription
faultOutContains the error if an exception occurs.
authenticationUser authentication
timeEntrySearchIdId of the time entry filter
Return valueReturns the loaded time entry filter

MarkTimeEntries

This method marks the transferred time entries with the corresponding marker in TimePunch.

void MarkTimeEntries(  
out TpFault fault,
TpAuthentication authentication,
List<Guid> selectedIds,
TimeEntryMarkAs markAs)
Needed PermissiontimeEntries@restrictedEdit
NameModifierDescription
faultOutContains the error if an exception occurs.
authenticationUser authentication
selectedIdsList of time entry ids to mark
markAsMarker that shall be set for the time entries Paid = 1 Important = 2 Onsite = 4

SaveTimeEntryFilter

This method saves a time entry filter in the database. The mapping is not carried out using the ID, but the name of the report filter.

TimeEntrySearchDto SaveTimeEntryFilter(  
out TpFault fault,
TpAuthentication authentication,
TimeEntrySearchDto timeEntryFilter);
Needed PermissiontimeEntryFilter@manage timeEntryFilter@managePublic
NameModifierDescription
faultOutContains the error if an exception occurs.
authenticationUser authentication
timeEntryFilterTime Entry Filter so save
Return valueThe stored time entry filter

SearchTimeEntries

This method searches for time-entries with the given filter. The permission of the authenticated user will be considered. Only time entries of the user profiles that the user is allowed to access will be returned.

List<TimeEntryDto> SearchTimeEntries(  
out TpFault fault,
TpAuthentication authentication,
TimeEntrySearchDto search);
Needed PermissiontimeEntries@access / core@switchIdentity
NameModifierDescription
faultOutContains the error if an exception occurs.
authenticationUser authentication
searchThe filter that is used to search the time entries
Return valueCollection with the found time entries

SearchTimeEntryFilters

This method uses the search filters criteria to find time entry filters in the database. A list of all the time entry filters found is then returned.

List<TimeEntrySearchDto> SearchTimeEntryFilters(  
out TpFault fault,
TpAuthentication authentication,
TimeEntryFilterSearchDto searchFilterCriteria);
Needed PermissiontimeEntryFilter@access
NameModifierDescription
faultOutContains the error if an exception occurs.
authenticationUser authentication
searchFilterCriteriaSearchfilter criteria
Return valueCollection containing the found time entry search objects

SplitTimeEntry

This method splits an existing time entry into several time entries.

void SplitTimeEntry(
out TpFault fault,
TpAuthentication authentication,
Guid timeEntryId,
List<TimeEntrySaveDto> timeEntries,
bool closeActiveTimeEntry);
Needed PermissiontimeEntries@restrictedEdit
NameModifierDescription
faultOutContains the error if an exception occurs.
authenticationUser authentication
GuidtimeEntryIdID of the time entry that shall be splitted. That can also be an ID of an active time entry.
TimeEntrySaveDto[]timeEntriesList of time entries that shall replace the time entry specified by it's ID
boolcloseActiveTimeEntryIf the time entry Id specifies an active entry, this flag indicates whether to close the time recording or not

UnmarkTimeEntries

This method removes the markers on the transferred time entries.

void UnmarkTimeEntries(  
out TpFault fault,
TpAuthentication authentication,
List<Guid> selectedIds,
TimeEntryMarkAs markAs);
Needed PermissiontimeEntries@restrictedEdit
NameModifierDescription
faultOutContains the error if an exception occurs.
authenticationUser authentication
selectedIdsList of time entry ids to mark
markAsMarker that shall be removed from the time entries Paid = 1 Important = 2 Onsite = 4

UpdateTimeEntryFilter

This method updates an existing time entry filter. To call the update method, the time entry filter to be updated should already exist.

TimeEntrySearchDto UpdateTimeEntryFilter(  
out TpFault fault,
TpAuthentication authentication,
TimeEntrySearchDto filter);
Needed PermissiontimeEntryFilter@manage timeEntryFilter@managePublic
NameModifierDescription
faultOutContains the error if an exception occurs.
authenticationUser authentication
filterTime Entry Filter so save
Return valueThe stored time entry filter

ValidateAndSaveBreakReplacement

This method was specially developed to be used by employees without special rights. It is used so that existing breaks, that is, the time between two time entries, can be assigned with a project by an employee without special rights.

TimeEntrySaveResultDto ValidateAndSaveBreakReplacement(  
out TpFault fault,
TpAuthentication authentication,
TimeEntrySaveDto timeEntry);
Needed PermissiontimeEntries@restrictedEdit
NameModifierDescription
faultOutContains the error if an exception occurs.
authenticationUser authentication
timeEntryTime entry that shall be stored in the database. The time entry must fit into a break time.
Return valueReturns the result of storing the time entry (Ok, BreakEnforced, EmptyBreakEntry) and the stored time entries

ValidateAndSaveRestrictedTimeEntry

This method is used to amend a time entry. Because the method needs less permission, one can only change the description, the project and the task of the time-entry.

TimeEntrySaveResultDto ValidateAndSaveRestrictedTimeEntry(  
out TpFault fault,
TpAuthentication authentication,
TimeEntryRestrictedSaveDto timeEntry);
Needed PermissiontimeEntries@restrictedEdit
NameModifierDescription
faultOutContains the error if an exception occurs.
authenticationUser authentication
timeEntryTime entry that shall be stored in the database.
Return valueReturns the result of storing the time entry (Ok, BreakEnforced, EmptyBreakEntry)

ValidateAndSaveTimeEntry

This method takes a time entry, validates it and saves it in the database.

TimeEntrySaveResultDto ValidateAndSaveTimeEntry(  
out TpFault fault,
TpAuthentication authentication,
TimeEntrySaveDto timeEntry);
Needed PermissiontimeEntries@manage
NameModifierDescription
faultOutContains the error if an exception occurs.
authenticationUser authentication
timeEntryTime entry that shall be stored in the database.
Return valueReturns the result of storing the time entry (Ok, BreakEnforced, EmptyBreakEntry)

ValidateAndSaveTimeEntrySeries

This method is used to create a time entry series, e.g. in order to create holiday entries. For that it’s necessary to define the start and end date. The concrete times are taken from the working times model of the user.

TimeEntrySaveResultDto ValidateAndSaveTimeEntrySeries(  
out TpFault fault,
TpAuthentication authentication,
TimeEntrySeriesDto timeEntrySeries);
Needed PermissiontimeEntries@manage
NameModifierDescription
faultOutContains the error if an exception occurs.
authenticationUser authentication
timeEntrySeriesTime entry series that shall be stored in the database.
Return valueReturns the result of storing the time entry (Ok, BreakEnforced, EmptyBreakEntry) and the stored time entries

ValidateAndSaveTimeEntrySeriesMultipleUsers

This method is used to create a time entry series, e.g. in order to create holiday entries. For that it’s necessary to define the start and end date. The concrete times are taken from the working times model of the user.

TimeEntrySaveResultDto ValidateAndSaveTimeEntrySeriesMultipleUsers(  
out TpFault fault,
TpAuthentication authentication,
TimeEntrySeriesDto timeEntrySeries,
Guid[] userIds);
Needed PermissiontimeEntries@manage
NameModifierDescription
faultOutContains the error if an exception occurs.
authenticationUser authentication
timeEntrySeriesTime entry series that shall be stored in the database.
Guid[]Array of user ids for whom the time entry series shall be created
Return valueReturns the result of storing the time entry (Ok, BreakEnforced, EmptyBreakEntry) and the stored time entries

ValidateAndSaveTimeEntryCopies

Using this method copies of time entries can be created, e.g. to create an entry that occurs on several day in a row. Maybe the staff member takes part on a weekly trainee.

TimeEntrySaveResultDto ValidateAndSaveTimeEntryCopies(  
out TpFault fault,
TpAuthentication authentication,
TimeEntrySaveDto timeEntry);
Needed PermissiontimeEntries@manage
NameModifierDescription
faultOutContains the error if an exception occurs.
authenticationUser authentication
timeEntryTime entry copy that shall be stored in the database.
Return valueReturns the result of storing the time entry (Ok, BreakEnforced, EmptyBreakEntry) and the stored time entries

ValidateAndSaveTimeEntryCopiesMultipleUsers

Using this method copies of time entries can be created, e.g. to create an entry that occurs on several day in a row. Maybe the staff member takes part on a weekly trainee.

TimeEntrySaveResultDto ValidateAndSaveTimeEntryCopiesMultipleUsers(  
out TpFault fault,
TpAuthentication authentication,
TimeEntrySaveDto timeEntry,
Guid[] userIds);
Needed PermissiontimeEntries@manage
NameModifierDescription
faultOutContains the error if an exception occurs.
authenticationUser authentication
timeEntryTime entry copy that shall be stored in the database.
Guid[]Array of user ids for whom the time entry copies shall be created
Return valueReturns the result of storing the time entry (Ok, BreakEnforced, EmptyBreakEntry) and the stored time entries

ValidatePermissionOfTimeEntry

This method validates the permisson to save a specific time entry by the user. In opposite to the ValidateAndSaveTimeEntry method the time entry won't be stored to the database.

TimeEntrySaveResultDto ValidatePermissionOfTimeEntry(  
out TpFault fault,
TpAuthentication authentication,
TimeEntrySaveDto timeEntry);
Needed PermissiontimeEntries@manage
NameModifierDescription
faultOutContains the error if an exception occurs.
authenticationUser authentication
timeEntryTime entry that shall be validated.
Return valueReturns NotSaved